fix(security): bound NewSession.lineId and SdpAnswer length - #296
Open
birme wants to merge 1 commit into
Open
Conversation
…#290) Add maxLength: 200 to NewSession.lineId (matching WHIP/WHEP convention) and maxLength: 65536 to SdpAnswer.sdpAnswer to prevent unbounded input being stored in the database. Adds a regression test asserting an over-long lineId is rejected with 400. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
maxLength: 200toNewSession.lineIdinsrc/models.ts(previously onlyminLength: 1), matching the existing WHIP/WHEP convention wherelineIdis already bounded to 200 chars. This prevents unbounded, attacker-controlled input from being persisted to the database viaPOST /session.maxLength: 65536toSdpAnswer.sdpAnswerinsrc/models.tsto cap the size of the SDP answer accepted byPATCH /session/:sessionId.src/api_validation.test.tsasserting a 201-charlineIdis rejected with HTTP 400 by thePOST /sessionschema.Test plan
npm test— 244 passed, 14 suites)npm run typecheck— no errors)npm run lint— 0 errors; only pre-existinganywarnings)npx prettier --checkon changed files)rejects lineId exceeding 200 characterspasses; over-longlineIdnow returns 400Closes #290
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com